package com.example.a2209_shop.adapter

import android.widget.CheckBox
import com.bumptech.glide.Glide
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.a2209_shop.R
import com.example.base.entity.ShopEntity

class ShopAdapter:BaseQuickAdapter<ShopEntity,BaseViewHolder>(R.layout.item_car) {
    override fun convert(holder: BaseViewHolder, item: ShopEntity) {
        holder.getView<CheckBox>(R.id.car_cb).isChecked = item.isCheck
        Glide.with(context).load(item.goods_default_icon).into(holder.getView(R.id.car_icon))
        holder.setText(R.id.car_desc,item.goods_desc)
        holder.setText(R.id.car_price,"￥${item.goods_default_price}")
        holder.setText(R.id.car_count,"${item.count}")
    }
}